[##_1C|1207505089.jpg|width="450" height="513" alt="open source symposium"|_##]
[##_1C|1147911437.jpg|width="450" height="464" alt="open source symposium"|_##]
Posted by 삐꾸강아쥐쥐
Posted by 삐꾸강아쥐쥐




,
opensourcesymposium



,
RedHat



,
다우



,
레드헷




Trackback URL : http://n-nuri.com/trackback/580
Following on from the previous example we now want to use the extra space in the "ops" volume group to make a database backup every evening. To ensure that the data that goes onto the tape is consistent we use an LVM snapshot logical volume.
A snapshot volume is a special type of volume that presents all the data that was in the volume at the time the snapshot was created. For a more detailed description, see Section 3.8 , Snapshots. This means we can back up that volume without having to worry about data being changed while the backup is going on, and we don't have to take the database volume offline while the backup is taking place.
![]() | In LVM1, this type of volume was read-only, but LVM2 creates read/write snapshots by default. |
There is a little over 500 Megabytes of free space in the "ops" volume group, so we will use all of it to allocate space for the snapshot logical volume. A snapshot volume can be as large or a small as you like but it must be large enough to hold all the changes that are likely to happen to the original volume during the lifetime of the snapshot. So here, allowing 500 megabytes of changes to the database volume which should be plenty.
# lvcreate -L592M -s -n dbbackup /dev/ops/databases |
![]() | Full snapshot are automatically disabled |
|---|---|
If the snapshot logical volume becomes full it will be dropped (become unusable) so it is vitally important to allocate enough space. The amount of space necessary is dependent on the usage of the snapshot, so there is no set recipe to follow for this. If the snapshot size equals the origin size, it will never overflow. |
We can now create a mount-point and mount the volume
# mkdir /mnt/ops/dbbackup |
If you are using XFS as the filesystem you will need to add the nouuid option to the mount command:
# mount /dev/ops/dbbackup /mnt/ops/dbbackup -onouuid,ro |
I assume you will have a more sophisticated backup strategy than this!
# tar -cf /dev/rmt0 /mnt/ops/dbbackup |
When the backup has finished you can now unmount the volume and remove it from the system. You should remove snapshot volume when you have finished with them because they take a copy of all data written to the original volume and this can hurt performance.
# umount /mnt/ops/dbbackup |
Posted by 삐꾸강아쥐쥐




,
linux



,
lvm



,
snapshot




Trackback URL : http://n-nuri.com/trackback/579
Posted by 삐꾸강아쥐쥐




,
See The Unseen



,
sk 브로드밴드



,
W&Whale



,
Where the story ends




Trackback URL : http://n-nuri.com/trackback/577
http://blog.n-nuri.com 이 접속이 안 될경우 http://x2x.dnip.net 으로 접속해 주세요 공유하지 않는 지식은 썩은 물과 같다~~~!!!
- 삐꾸강아쥐쥐
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |